import axios from '@/utils/request'

// 获取客户列表接口函数
export function getClients(params) {
  // console.log(params)
  return axios({
    url: '/clients',
    method: 'get',
    params
  })
}

// 获取客户列表数量接口函数
export function getClientsCount(params) {
  return axios({
    url: '/clients/count',
    method: 'get',
    params
  })
}

// 新增客户
export function addClients(data) {
  return axios({
    url: '/clients',
    method: 'post',
    data
  })
}
// 根据id删除客户数据
export function delClients(id) {
  return axios({
    url: '/clients/' + id,
    method: 'DELETE'
  })
}

// 获取指定客户信息数据接口函数
export function getClientsInfo(id) {
  return axios({
    url: '/clients/' + id,
    method: 'get'
  })
}

// 根据id编辑客户信息
export function editClients(data) {
  return axios({
    url: '/clients/' + data.id,
    method: 'put',
    data
  })
}
